const web = require("../../module/web"), loger = require("../../module/loger");

module.exports.run = (yzm)=>{
	web.run((w)=>{
		let inp = w.window.document.getElementsByClassName("quc-input quc-input-sms-token");
		yzm = yzm.match(/\d{6}/g);
		if(yzm) yzm = yzm[0];
		if(inp && inp[0]) inp[0].value = yzm;
		inp = w.window.document.getElementsByClassName("quc-button quc-button-sign-up");
		if(inp && inp[0]) inp[0].click();
	}, (w)=>{ //页面重新加载后
		let uf = w.window.document.getElementById("userinfo");
		if(uf){
			let al = uf.getElementsByTagName("a");
			
			for(let i=0;i<al.length;i++){
				if(al[i].innerHTML == "退出"){
					global.sdObj.end = 0;
					return true;
				}
			}		
		}			
	})
}